See http://confluence.atlassian.com/display/DEVNET/How+to+Build+an+Atlassian+Plugin
These instructions were written for Crytek's 3.13.3 jira installation

 1) Download and install JDK 5
 
 2) Download and install Maven 2
 
 3) Download and install Eclipse
 
 4) Download and install Maven Integration for Eclipse (http://m2eclipse.codehaus.org/)
 
 5) Save http://confluence.atlassian.com/display/DEVNET/Example+settings.xml to C:/Documents and Settings/$MY_USER_NAME$/.m2
 
 6) Download JavaMail 1.3.3 (http://java.sun.com/products/javamail/javamail-1_3_3.html) and save it to a temporary folder
 
 7) Download JTA 1.0.1B classes (http://java.sun.com/javaee/technologies/jta/index.jsp) and save it to a temporary folder
 
 8) Download JavaBeans Activation Framework (JAF) 1.0.2 (http://java.sun.com/products/archive/javabeans/jaf102.html) and save it to a temporary folder
 
 9) Download Jira RPC Plugin 3.13.3-1 (http://repository.atlassian.com/atlassian-jira-rpc-plugin/jars/atlassian-jira-rpc-plugin-3.13.3-1.jar) and save it to a temporary folder
  
10) Extract jar files from the above downloads to a temporary folder (probably only from JavaMail and JavaBeans Activation Framework)
 
11) Run "installExtraBinaries.bat $TEMP_DIR" where $TEMP_DIR is the name of your temporary download folder

12) download  JIRA Misc Workflow Extensions (from here: https://plugins.atlassian.com/plugin/details/292) into \Code\Tools\CrashHandler\JiraPlugin\crashHandler\debug\jira\jira-webapp\WEB-INF\lib this will fix a problem with the workflow action


TO CREATE A NEW PLUGIN:

12) Run createArchitypes.bat (create the plugin skeleton)

13) Fill in the TODO entries in CrashHandler/pom.xml

14) Import the plugin as a Maven Project in eclipse



EXTRA INFO:
If you need to increase the size of the heap used by the JVM:
1) Find a file with a name similar to atlassian-plugin-pom-9.pom in your m2 repository (mine was in C:\Documents and Settings\alexmc\.m2\repository\com\atlassian\pom\atlassian-plugin-pom\9)

2) Change the -Xmx argument in <jvmargs>

DEBUG:
use eclipse to debug the project, on 5005 you can debug confluence. you can debug it going on run->Debug Configurations... from the left menu select 
"Remote Java Application" press on new (the "new" button is on the top left) and put Host:localhost Port:5006

DATABASE:
if you need to watch the content of the jira database run the hsqldb.bat instruction are in the shell executed (the database needs to be imported in jira before)

